package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
public class Zdeliverydelivery {
    private int deliverydeliveryId;//交付计划详情ID
    private Zdelivery deliveryId;//交付计划ID
    private Qproductdetail prodetailId;//产品id
    private Integer deliverydeliveryNumber;//产品数量4
    private BigDecimal deliverydeliveryJg;//价格
    private String deliverydeliveryCondition;//计划详情交付条件
    private String deliverydeliveryRequire;//计划详情要求

    @Id
    @Column(name = "deliverydelivery_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getDeliverydeliveryId() {
        return deliverydeliveryId;
    }

    public void setDeliverydeliveryId(int deliverydeliveryId) {
        this.deliverydeliveryId = deliverydeliveryId;
    }

    @ManyToOne
    @JoinColumn(name = "delivery_id", referencedColumnName = "delivery_id")
    public Zdelivery getDeliveryId() {
        return deliveryId;
    }

    public void setDeliveryId(Zdelivery deliveryId) {
        this.deliveryId = deliveryId;
    }

    @ManyToOne
    @JoinColumn(name = "prodetail_id", referencedColumnName = "prodetail_id")
    public Qproductdetail getProdetailId() {
        return prodetailId;
    }

    public void setProdetailId(Qproductdetail prodetailId) {
        this.prodetailId = prodetailId;
    }

    @Basic
    @Column(name = "deliverydelivery_number")
    public Integer getDeliverydeliveryNumber() {
        return deliverydeliveryNumber;
    }

    public void setDeliverydeliveryNumber(Integer deliverydeliveryNumber) {
        this.deliverydeliveryNumber = deliverydeliveryNumber;
    }

    @Basic
    @Column(name = "deliverydelivery_jg")
    public BigDecimal getDeliverydeliveryJg() {
        return deliverydeliveryJg;
    }

    public void setDeliverydeliveryJg(BigDecimal deliverydeliveryJg) {
        this.deliverydeliveryJg = deliverydeliveryJg;
    }

    @Basic
    @Column(name = "deliverydelivery_condition")
    public String getDeliverydeliveryCondition() {
        return deliverydeliveryCondition;
    }

    public void setDeliverydeliveryCondition(String deliverydeliveryCondition) {
        this.deliverydeliveryCondition = deliverydeliveryCondition;
    }

    @Basic
    @Column(name = "deliverydelivery_require")
    public String getDeliverydeliveryRequire() {
        return deliverydeliveryRequire;
    }

    public void setDeliverydeliveryRequire(String deliverydeliveryRequire) {
        this.deliverydeliveryRequire = deliverydeliveryRequire;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zdeliverydelivery that = (Zdeliverydelivery) o;
        return deliverydeliveryId == that.deliverydeliveryId &&
                Objects.equals(deliveryId, that.deliveryId) &&
                Objects.equals(prodetailId, that.prodetailId) &&
                Objects.equals(deliverydeliveryNumber, that.deliverydeliveryNumber) &&
                Objects.equals(deliverydeliveryCondition, that.deliverydeliveryCondition) &&
                Objects.equals(deliverydeliveryRequire, that.deliverydeliveryRequire);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deliverydeliveryId, deliveryId, prodetailId, deliverydeliveryNumber, deliverydeliveryCondition, deliverydeliveryRequire);
    }

}
